From f0bcc3788e3a75b9335b333703ee6ea8b313ff63 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Sun, 24 Nov 2013 02:54:38 +0000 Subject: [PATCH] Fixes for stmwpp.cc in NEW_STRINGS. --- gpsbabel/stmwpp.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gpsbabel/stmwpp.cc b/gpsbabel/stmwpp.cc index 303a2cdbb..0cbd2531a 100644 --- a/gpsbabel/stmwpp.cc +++ b/gpsbabel/stmwpp.cc @@ -135,7 +135,11 @@ stmwpp_data_read(void) break; case 2: +#if NEW_STRINGS + wpt->shortname = QString::fromLatin1(c); +#else wpt->shortname = xstrdup(c); +#endif break; case 3: @@ -246,8 +250,8 @@ stmwpp_waypt_cb(const waypoint* wpt) snprintf(cdate, sizeof(cdate), "%02d/%02d/%04d", tm.tm_mon, tm.tm_mday, tm.tm_year); snprintf(ctime, sizeof(ctime), "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec); + String sn; switch (what) { - char* sn; case STM_WAYPT: case STM_RTEPT: @@ -256,8 +260,11 @@ stmwpp_waypt_cb(const waypoint* wpt) } else { sn = mkshort(short_h, wpt->shortname); } - gbfprintf(fout, "WP,D,%s,", sn); + gbfprintf(fout, "WP,D,%s,", CSTRc(sn)); +#if NEW_STRINGS +#else xfree(sn); +#endif break; case STM_TRKPT: -- 2.30.2